// eslint-disable-next-line @typescript-eslint/no-unused-vars
var vm

document.addEventListener(
  'visibilitychange',
  (e) => {
    const title = '小江的心灵栖息站'
    const text1 = '多看一会嘛o(>﹏<)o'
    const text2 = '咦~ 你又回来了O(∩_∩)O哈哈~'
    // 离开此标签
    document.title = document.hidden ? text1 : text2
    //进入此标签页
    !document.hidden &&
      window.setTimeout(() => {
        document.title = title
      }, 2000)
  },
  false,
)

// eslint-disable-next-line @typescript-eslint/no-unused-vars
!(function (e, t, a) {
  function r() {
    for (var e = 0; e < s.length; e++)
      s[e].alpha <= 0
        ? (t.body.removeChild(s[e].el), s.splice(e, 1))
        : (s[e].y--,
          (s[e].scale += 0.004),
          (s[e].alpha -= 0.013),
          (s[e].el.style.cssText =
            'left:' +
            s[e].x +
            'px;top:' +
            s[e].y +
            'px;opacity:' +
            s[e].alpha +
            ';transform:scale(' +
            s[e].scale +
            ',' +
            s[e].scale +
            ') rotate(45deg);background:' +
            s[e].color +
            ';z-index:99999'))
    requestAnimationFrame(r)
  }
  function n() {
    var t = 'function' == typeof e.onclick && e.onclick
    e.onclick = function (e) {
      t && t(), o(e)
    }
  }
  function o(e) {
    var a = t.createElement('div')
    ;(a.className = 'heart'),
      s.push({
        el: a,
        x: e.clientX - 5,
        y: e.clientY - 5,
        scale: 1,
        alpha: 1,
        color: c(),
      }),
      t.body.appendChild(a)
  }
  function i(e) {
    var a = t.createElement('style')
    a.type = 'text/css'
    try {
      a.appendChild(t.createTextNode(e))
    } catch (t) {
      a.styleSheet.cssText = e
    }
    t.getElementsByTagName('head')[0].appendChild(a)
  }
  function c() {
    return 'rgb(' + ~~(255 * Math.random()) + ',' + ~~(255 * Math.random()) + ',' + ~~(255 * Math.random()) + ')'
  }
  var s = []
  ;(e.requestAnimationFrame =
    e.requestAnimationFrame ||
    e.webkitRequestAnimationFrame ||
    e.mozRequestAnimationFrame ||
    e.oRequestAnimationFrame ||
    e.msRequestAnimationFrame ||
    function (e) {
      setTimeout(e, 1e3 / 60)
    }),
    i(
      ".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}",
    ),
    n(),
    r()
})(window, document)

/* 样式代码 */
var styleTitle1 = `
font-size: 20px;
font-weight: 600;
color: rgb(244,167,89);
`
// eslint-disable-next-line @typescript-eslint/no-unused-vars
var styleTitle2 = `
font-style: oblique;
font-size:14px;
color: rgb(244,167,89);
font-weight: 400;
`
var styleContent = `
color: rgb(30,152,255);
`

/* 内容代码 */
var title1 = '🌒 小江的心灵栖息站 '

// => 读取配置型(在配置文件里配置这些会变动的网址)
var offiUrl = ''
var content = `
版 本 号：1.0
编译日期：${new Date().toLocaleString()}
站点介绍：
1. 一个乱七八糟的杂货铺，希望能给你带来惊喜.
2. 随笔记录，总结与分享.
🏠官网:  ${offiUrl}
📞QQ/VX: 954583943
`
console.log(
  `%c${title1}
%c${content}`,
  styleTitle1,
  styleContent,
)
